IOMMU/x86: fix type ref-counting race upon IOMMU page table construction
authorJan Beulich <jbeulich@suse.com>
Tue, 5 Mar 2019 13:59:48 +0000 (14:59 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 5 Mar 2019 13:59:48 +0000 (14:59 +0100)
commit4f785ea01cf2e689e66f993bfa2e0c86a5d6b2d3
tree7e64a93510e5650efedbb30fd34c9537622da9a4
parent1028304d4244df2ee9af0ca37ee8a6f998c61d9c
IOMMU/x86: fix type ref-counting race upon IOMMU page table construction

When arch_iommu_populate_page_table() gets invoked for an already
running guest, simply looking at page types once isn't enough, as they
may change at any time. Add logic to re-check the type after having
mapped the page, unmapping it again if needed.

This is XSA-285.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tentatively-Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 1f0b0bb7773d537bcf169e021495d0986d9809fc
master date: 2019-03-05 13:47:36 +0100
xen/drivers/passthrough/x86/iommu.c